Overview |
Basic Operation - It is important to understand the recording process before attempting to use the control in an application. The CDWriterPro ActiveX control is capable of writing data CDs and basic audio CDs. All other functionality is used to support these operations. By far, the most useful feature of CDWriterPro, is the ability to record data CDs. The uses for this feature include data archiving, creating kiosks, and a multitude of other applications. The CDWriterPro supports writing ISO9660 or Joliet data discs to CDR/CDRW drives. The currently supported writing formats are: CD-R, CD-R/W. Although, CDWriterPro can recognize DVD media types, it does NOT support writing to DVD media.
Writing Data CD/DVDs - A data track is written to the CD just like an audio track except a directory structure is written along with file data as one contiguous track. Only one data track can be read by the OS at one time. Unlike audio, the last data track on the CD is the one which the OS will use to determine which files are on the disc. All previous data tracks are disregarded unless they were linked into the image of last track/session written. In other words, on a disc with multiple data tracks, the OS will only see the last recorded data track. Linking (importing a previous session/track) allows files from previous data tracks to be visible from the last session recorded. This is done by including the address of previously written files (of the previous data track) in the directory structure of the new data track's image. This is commonly called 'continuing a multi-session disc'. This functionality allows an update/addition of files (written previously) without the need to write all of the file data again - except the updated files. After a data track has been written, either the session or the disc should be closed. The disc should be closed if no further data needs to be written to the disc - ever. At the very least, the session should be closed so that the disc is usable. Some operating systems do not recognize unclosed data tracks. The OS may also need the disc ejected and reloaded before recognizing a newly recorded data track.
Two compliance levels of ISO9660 are supported by the control, Level 1 and Level 2. The ISO9660 Level 1 standard allows an 8 character filename + 3 character extension. This is often referred to as 8.3 format. Most off-the-shelf software on CD comes in this format. Level 2 offers more relaxed restrictions (31 characters maximum). ISO9660 also limits any given fully qualified path to 255 characters and does not allow a directory depth of more than 8 directories deep. We do not enforce directory depth or path size for the ISO9660 portion of the volume. This is the developers responsibility. We do however enforce file/folder names for the selected compliance level, and provide the directory depth for you.
Joliet is a more common format among Windows users because it supports file and directory names of up to 64 characters. It also allows characters which are more favorable to the long filename conventions of Windows. Joliet also has no restrictions on directory tree depth or path size. We recommend including Joliet for Window's users.
To create a data image for a track, files and/or directories can be added either one at a time (InsertISOItem) , or an entire directory can be cloned (CloneDirectoryToISO) to an destination image path. The control will not validate filename lengths, but it will alter names as needed to conform the current image specifications (ISO9660 or Joliet). As each item is added to the image, a ISOItemAdded event will indicate a successful addition. When the appropriate files have been added to the image, set various properties as required (e.g. CloseSession, CloseDisc, CacheImage), and call WriteDisc to begin the recording operation. See the sample code included with the product download. Use the caching option if recording from a network source, or on a slow system.
If the last session needs to be imported, it must be done prior to adding any other items to the image. If you record a session/track with 'FileA.txt', and then record another session/track with 'FileB.txt'; only 'FileB.txt' will appear in the OS's file system. The first session is superseded by the last session. The only way around this problem, is by importing the previous session into the new data image. Importing a data track links a previous session's file information with the new session. CDWriterPro supports this technology by using the ImportISOTrack method. If importing is not used, a new session will overwrite the previous session and all of the files must be written again (taking up unnecessary space). After importing the last session, follow the section above to write the disc. Important: Only the last session/track is imported by the control to prevent confusion. The disc must remain present in the drive after the import, or the recording will not work properly. CDWriterPro relies on the presence of the imported disc for a successful write operation.
Audio CDs- Audio CDs can be created from the control consisting of tracks from .wav source files. Audio discs are recorded in TAO (Track-at-Once) recording mode. TAO is supported by almost every CD-R on the market. Tracks can be added to an audio image by using the InsertAudioTrack method of the control. Tracks can be inserted, removed, and enumerated using various audio track specific methods of the control. The .wav files must be 16 bit, stereo, and 44.1khz format in order to be used with the control. After adding the tracks to the audio image, set the CloseDisc and CloseSession properties to a value of True. The disc and session must be closed to allow playback on 'normal' CD players. The WriteType property must also be set for audio recording. Use the WriteDisc method to initiate recording to the CD-R drive.
Other Operations - A number of utility features exist to manage the writing process.
To solve speed issues associated with collections, extensive use was made of enumeration callback events. Instead of needing to manage large collections of data (e.g. ISO items), methods may be called which will fire an event for each item in the control's collection. For example, to get a list of ISO files added to an image directory, one would make a call to EnumerateISOItems. This method would cause the control to fire the EnumISOItems event for each item in the associated image path. This type of architecture makes it easy to manage tree views and lists of image items. This same approach is also used for audio data through the EnumerateAudioTracks method and the EnumAudioTrack event.
The ISO image may be saved as a generic ISO file for use by other applications using the CreateISOImageFile method. Generic ISO files can also be written by the control using the WriteISOImage method. The only constraint using this method is that the disc must be blank.
Many methods exist for removing, renaming, and adding directory/file items. Most of these methods have corresponding events to confirm the operation, and to modify the GUI to reflect the changes. For example, when a directory is renamed using RenameISODirectory, all of the image destination paths for the child items change. To reflect this modification, the ISODestPathChanged event will fire for each child item so modifications can be made to the item's GUI components if necessary. The samples contain working examples of this functionality.
CDWriterPro takes great care in reporting very detailed errors when required. A number of enumerations/constants exist for explaining error conditions. We have attempted to accommodate most drives on the market, but due to the changing nature of this technology, we do not guarantee universal functionality with every drive. Please read about the different error types and conditions conveyed through the WriteError, and ReadingTrackFileError events. We have spent considerable time and effort to minimize error related issues. Literally several hundred errors are possible, but for the most part, developers do not need to worry about this complexity. Licensing - After purchasing a CDWriterPro developer license, a download link to the fully functional licensed version will be provided with your receipt. This fully functional (non-trial) version of the control will need to be registered by setting the LicenseCode property with the code sent with the receipt of purchase (usually an email). This property may be set at runtime, or at design time. The developer license allows runtime distribution of the control for commercial applications without any further fees or royalty payments (subject to change). |